package com.itheima.product;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * <dl>
 * <dd>描述: ~节点业务逻辑实现</dd>
 * <dd>创建时间：  14:47 2020/7/26</dd>
 * <dd>创建人： zz</dd>
 * <dt>版本历史: </dt>
 * <pre>
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2020/7/26      guodong       1.0        1.0 Version
 * </pre>
 * </dl>
 */
@RestController
public class ProductController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    /*
        发送消息
     */
    @GetMapping("sendDirectMsg/{exchange}/{routingKey}/{msg}")
    public void sendDirectMsg(@PathVariable String exchange,
                              @PathVariable String routingKey,
                              @PathVariable String msg){
        rabbitTemplate.convertAndSend(exchange, routingKey, msg);
    }
}
